package com.hgk.wanwan.main.fragment;


import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;

import com.hgk.common.common.constants.DataConstants;
import com.hgk.common.common.constants.StatisticConstants;
import com.hgk.common.common.ui.fragment.TitleFragment;
import com.hgk.common.common.ui.view.RippleView;
import com.hgk.common.common.util.StatisticsUtil;
import com.hgk.wanwan.login.LoginActivity;
import com.hgk.wanwan.main.MainActivity;

import width.hgk.wanwan.R;

/**
 * A simple {@link Fragment} subclass.
 */
public class JumpLoginFragment extends TitleFragment {


    private RippleView mRvJumpLogin;
    private MainActivity mMainActivity;
    public JumpLoginFragment() {
        // Required empty public constructor
    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        return inflater.inflate(R.layout.fragment_jump_login, container, false);
    }

    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        if (getActivity() instanceof MainActivity){
            mMainActivity = (MainActivity) getActivity();
        }
        mRvJumpLogin = (RippleView) view.findViewById(R.id.rv_jumplogin);
        mRvJumpLogin.setOnRippleCompleteListener(new RippleView.OnRippleCompleteListener() {
            @Override
            public void onComplete(RippleView rippleView) {
                StatisticsUtil.onEvent(mContext, StatisticConstants.EVENT_PERSON_CENTER,"登录、注册按钮被点击");
                LoginActivity.launch(mContext, DataConstants.MAIN_ACTIVITY_VALUE);
            }
        });
    }

    @Override
    public void setLeftButton(RelativeLayout relativeLayout, Button button) {

    }

    @Override
    public void setRightButton(RelativeLayout relativeLayout, Button button) {

    }

    @Override
    public void setTitleView(LinearLayout linearlayout) {

    }

    @Override
    public Object getTitleString() {
        return null;
    }

    @Override
    public int getBodyView() {
        return 0;
    }
}
